<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GtkBuilder</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GTK+ 2 Reference Manual">
<link rel="up" href="Builder.html" title="Interface builder">
<link rel="prev" href="GtkBuildable.html" title="GtkBuildable">
<link rel="next" href="DeprecatedObjects.html" title="Deprecated">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="GtkBuildable.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="Builder.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GTK+ 2 Reference Manual</th>
<td><a accesskey="n" href="DeprecatedObjects.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#GtkBuilder.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#GtkBuilder.description" class="shortcut">Description</a>
                   | 
                  <a href="#GtkBuilder.object-hierarchy" class="shortcut">Object Hierarchy</a>
                   | 
                  <a href="#GtkBuilder.properties" class="shortcut">Properties</a>
</td></tr>
</table>
<div class="refentry">
<a name="GtkBuilder"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GtkBuilder.top_of_page"></a>GtkBuilder</span></h2>
<p>GtkBuilder — Build an interface from an XML UI definition</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="GtkBuilder.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;gtk/gtk.h&gt;

struct              <a class="link" href="GtkBuilder.html#GtkBuilder-struct" title="struct GtkBuilder">GtkBuilder</a>;
<span class="returnvalue">void</span>                (<a class="link" href="GtkBuilder.html#GtkBuilderConnectFunc" title="GtkBuilderConnectFunc ()">*GtkBuilderConnectFunc</a>)            (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *object</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *signal_name</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *handler_name</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *connect_object</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#GConnectFlags"><span class="type">GConnectFlags</span></a> flags</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
enum                <a class="link" href="GtkBuilder.html#GtkBuilderError" title="enum GtkBuilderError">GtkBuilderError</a>;
<a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="returnvalue">GtkBuilder</span></a> *        <a class="link" href="GtkBuilder.html#gtk-builder-new" title="gtk_builder_new ()">gtk_builder_new</a>                     (<em class="parameter"><code><span class="type">void</span></code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               <a class="link" href="GtkBuilder.html#gtk-builder-add-from-file" title="gtk_builder_add_from_file ()">gtk_builder_add_from_file</a>           (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filename</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               <a class="link" href="GtkBuilder.html#gtk-builder-add-from-string" title="gtk_builder_add_from_string ()">gtk_builder_add_from_string</a>         (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *buffer</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> length</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               <a class="link" href="GtkBuilder.html#gtk-builder-add-objects-from-file" title="gtk_builder_add_objects_from_file ()">gtk_builder_add_objects_from_file</a>   (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filename</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **object_ids</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               <a class="link" href="GtkBuilder.html#gtk-builder-add-objects-from-string" title="gtk_builder_add_objects_from_string ()">gtk_builder_add_objects_from_string</a> (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *buffer</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> length</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **object_ids</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject"><span class="returnvalue">GObject</span></a> *           <a class="link" href="GtkBuilder.html#gtk-builder-get-object" title="gtk_builder_get_object ()">gtk_builder_get_object</a>              (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="returnvalue">GSList</span></a> *            <a class="link" href="GtkBuilder.html#gtk-builder-get-objects" title="gtk_builder_get_objects ()">gtk_builder_get_objects</a>             (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="GtkBuilder.html#gtk-builder-connect-signals" title="gtk_builder_connect_signals ()">gtk_builder_connect_signals</a>         (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="GtkBuilder.html#gtk-builder-connect-signals-full" title="gtk_builder_connect_signals_full ()">gtk_builder_connect_signals_full</a>    (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
                                                         <em class="parameter"><code><a class="link" href="GtkBuilder.html#GtkBuilderConnectFunc" title="GtkBuilderConnectFunc ()"><span class="type">GtkBuilderConnectFunc</span></a> func</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="GtkBuilder.html#gtk-builder-set-translation-domain" title="gtk_builder_set_translation_domain ()">gtk_builder_set_translation_domain</a>  (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *domain</code></em>);
const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       <a class="link" href="GtkBuilder.html#gtk-builder-get-translation-domain" title="gtk_builder_get_translation_domain ()">gtk_builder_get_translation_domain</a>  (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>);
<a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="returnvalue">GType</span></a>               <a class="link" href="GtkBuilder.html#gtk-builder-get-type-from-name" title="gtk_builder_get_type_from_name ()">gtk_builder_get_type_from_name</a>      (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *type_name</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GtkBuilder.html#gtk-builder-value-from-string" title="gtk_builder_value_from_string ()">gtk_builder_value_from_string</a>       (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a> *pspec</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GtkBuilder.html#gtk-builder-value-from-string-type" title="gtk_builder_value_from_string_type ()">gtk_builder_value_from_string_type</a>  (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> type</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
#define             <a class="link" href="GtkBuilder.html#GTK-BUILDER-WARN-INVALID-CHILD-TYPE:CAPS" title="GTK_BUILDER_WARN_INVALID_CHILD_TYPE()">GTK_BUILDER_WARN_INVALID_CHILD_TYPE</a> (object,
                                                         type)
#define             <a class="link" href="GtkBuilder.html#GTK-BUILDER-ERROR:CAPS" title="GTK_BUILDER_ERROR">GTK_BUILDER_ERROR</a>
</pre>
</div>
<div class="refsect1">
<a name="GtkBuilder.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
  <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
   +----GtkBuilder
</pre>
</div>
<div class="refsect1">
<a name="GtkBuilder.properties"></a><h2>Properties</h2>
<pre class="synopsis">
  "<a class="link" href="GtkBuilder.html#GtkBuilder--translation-domain" title='The "translation-domain" property'>translation-domain</a>"       <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>*                : Read / Write
</pre>
</div>
<div class="refsect1">
<a name="GtkBuilder.description"></a><h2>Description</h2>
<p>
A GtkBuilder is an auxiliary object that reads textual descriptions
of a user interface and instantiates the described objects. To pass a
description to a GtkBuilder, call <a class="link" href="GtkBuilder.html#gtk-builder-add-from-file" title="gtk_builder_add_from_file ()"><code class="function">gtk_builder_add_from_file()</code></a> or
<a class="link" href="GtkBuilder.html#gtk-builder-add-from-string" title="gtk_builder_add_from_string ()"><code class="function">gtk_builder_add_from_string()</code></a>. These functions can be called multiple
times; the builder merges the content of all descriptions.
</p>
<p>
A GtkBuilder holds a reference to all objects that it has constructed
and drops these references when it is finalized. This finalization can
cause the destruction of non-widget objects or widgets which are not
contained in a toplevel window. For toplevel windows constructed by a
builder, it is the responsibility of the user to call <a class="link" href="GtkWidget.html#gtk-widget-destroy" title="gtk_widget_destroy ()"><code class="function">gtk_widget_destroy()</code></a>
to get rid of them and all the widgets they contain.
</p>
<p>
The functions <a class="link" href="GtkBuilder.html#gtk-builder-get-object" title="gtk_builder_get_object ()"><code class="function">gtk_builder_get_object()</code></a> and <a class="link" href="GtkBuilder.html#gtk-builder-get-objects" title="gtk_builder_get_objects ()"><code class="function">gtk_builder_get_objects()</code></a>
can be used to access the widgets in the interface by the names assigned
to them inside the UI description. Toplevel windows returned by these
functions will stay around until the user explicitly destroys them
with <a class="link" href="GtkWidget.html#gtk-widget-destroy" title="gtk_widget_destroy ()"><code class="function">gtk_widget_destroy()</code></a>. Other widgets will either be part of a
larger hierarchy constructed by the builder (in which case you should
not have to worry about their lifecycle), or without a parent, in which
case they have to be added to some container to make use of them.
Non-widget objects need to be reffed with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-ref"><code class="function">g_object_ref()</code></a> to keep them
beyond the lifespan of the builder.
</p>
<p>
The function <a class="link" href="GtkBuilder.html#gtk-builder-connect-signals" title="gtk_builder_connect_signals ()"><code class="function">gtk_builder_connect_signals()</code></a> and variants thereof can be
used to connect handlers to the named signals in the description.
</p>
<div class="refsect2">
<a name="BUILDER-UI"></a><h3>GtkBuilder UI Definitions</h3>
<p>
GtkBuilder parses textual descriptions of user interfaces which
are specified in an XML format which can be roughly described
by the DTD below. We refer to these descriptions as
<em class="firstterm">GtkBuilder UI definitions</em> or just
<em class="firstterm">UI definitions</em> if the context is clear.
Do not confuse GtkBuilder UI Definitions with
<a class="link" href="GtkUIManager.html#XML-UI" title="UI Definitions">GtkUIManager UI Definitions</a>,
which are more limited in scope.
</p>
<p>
</p>
<pre class="programlisting">
&lt;!ELEMENT interface (requires|object)* &gt;
&lt;!ELEMENT object    (property|signal|child|ANY)* &gt;
&lt;!ELEMENT property  PCDATA &gt;
&lt;!ELEMENT signal    EMPTY &gt;
&lt;!ELEMENT requires  EMPTY &gt;
&lt;!ELEMENT child     (object|ANY*) &gt;
&lt;!ATTLIST interface  domain         	    #IMPLIED &gt;
&lt;!ATTLIST object     id             	    #REQUIRED
                     class          	    #REQUIRED
                     type-func      	    #IMPLIED
                     constructor    	    #IMPLIED &gt;
&lt;!ATTLIST requires   lib             	    #REQUIRED
                     version          	    #REQUIRED &gt;
&lt;!ATTLIST property   name           	    #REQUIRED
                     translatable   	    #IMPLIED
                     comments               #IMPLIED
                     context                #IMPLIED &gt;
&lt;!ATTLIST signal     name           	    #REQUIRED
                     handler        	    #REQUIRED
                     after          	    #IMPLIED
                     swapped        	    #IMPLIED
                     object         	    #IMPLIED
                     last_modification_time #IMPLIED &gt;
&lt;!ATTLIST child      type           	    #IMPLIED
                     internal-child 	    #IMPLIED &gt;
</pre>
<p>
</p>
<p>
The toplevel element is &lt;interface&gt;.
It optionally takes a "domain" attribute, which will make
the builder look for translated strings using <code class="function">dgettext()</code> in the
domain specified. This can also be done by calling
<a class="link" href="GtkBuilder.html#gtk-builder-set-translation-domain" title="gtk_builder_set_translation_domain ()"><code class="function">gtk_builder_set_translation_domain()</code></a> on the builder.
Objects are described by &lt;object&gt; elements, which can
contain &lt;property&gt; elements to set properties, &lt;signal&gt;
elements which connect signals to handlers, and &lt;child&gt;
elements, which describe child objects (most often widgets
inside a container, but also e.g. actions in an action group,
or columns in a tree model). A &lt;child&gt; element contains
an &lt;object&gt; element which describes the child object.
The target toolkit version(s) are described by &lt;requires&gt;
elements, the "lib" attribute specifies the widget library in
question (currently the only supported value is "gtk+") and the "version"
attribute specifies the target version in the form "&lt;major&gt;.&lt;minor&gt;".
The builder will error out if the version requirements are not met.
</p>
<p>
Typically, the specific kind of object represented by an
&lt;object&gt; element is specified by the "class" attribute.
If the type has not been loaded yet, GTK+ tries to find the
<code class="function"><code class="function">_get_type()</code></code> from the class name by applying
heuristics. This works in most cases, but if necessary, it is
possible to specify the name of the <code class="function"><code class="function">_get_type()</code></code>
explictly with the "type-func" attribute. As a special case,
GtkBuilder allows to use an object that has been constructed
by a <a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> in another part of the UI definition by
specifying the id of the <a class="link" href="GtkUIManager.html" title="GtkUIManager"><span class="type">GtkUIManager</span></a> in the "constructor"
attribute and the name of the object in the "id" attribute.
</p>
<p>
Objects must be given a name with the "id" attribute, which
allows the application to retrieve them from the builder with
<a class="link" href="GtkBuilder.html#gtk-builder-get-object" title="gtk_builder_get_object ()"><code class="function">gtk_builder_get_object()</code></a>. An id is also necessary to use the
object as property value in other parts of the UI definition.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>Prior to 2.20, GtkBuilder was setting the "name"
property of constructed widgets to the "id" attribute. In GTK+
2.20 or newer, you have to use <a class="link" href="GtkBuildable.html#gtk-buildable-get-name" title="gtk_buildable_get_name ()"><code class="function">gtk_buildable_get_name()</code></a> instead
of <a class="link" href="GtkWidget.html#gtk-widget-get-name" title="gtk_widget_get_name ()"><code class="function">gtk_widget_get_name()</code></a> to obtain the "id", or set the "name"
property in your UI definition.
</p>
</div>
<p>
Setting properties of objects is pretty straightforward with
the &lt;property&gt; element: the "name" attribute specifies
the name of the property, and the content of the element
specifies the value. If the "translatable" attribute is
set to a true value, GTK+ uses <code class="function">gettext()</code> (or <code class="function">dgettext()</code> if
the builder has a translation domain set) to find a translation
for the value. This happens before the value is parsed, so
it can be used for properties of any type, but it is probably
most useful for string properties. It is also possible to
specify a context to disambiguate short strings, and comments
which may help the translators.
</p>
<p>
GtkBuilder can parse textual representations for the most
common property types: characters, strings, integers, floating-point
numbers, booleans (strings like "TRUE", "t", "yes", "y", "1" are
interpreted as <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, strings like "FALSE, "f", "no", "n", "0" are
interpreted as <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>), enumerations (can be specified by their
name, nick or integer value), flags (can be specified by their name,
nick, integer value, optionally combined with "|", e.g.
"GTK_VISIBLE|GTK_REALIZED")  and colors (in a format understood by
<a href="../gdk/gdk-Colormaps-and-Colors.html#gdk-color-parse"><code class="function">gdk_color_parse()</code></a>). Objects can be referred to by their name.
Pixbufs can be specified as a filename of an image file to load.
In general, GtkBuilder allows forward references to objects —
an object doesn't have to constructed before it can be referred to.
The exception to this rule is that an object has to be constructed
before it can be used as the value of a construct-only property.
</p>
<p>
Signal handlers are set up with the &lt;signal&gt; element.
The "name" attribute specifies the name of the signal, and the
"handler" attribute specifies the function to connect to the signal.
By default, GTK+ tries to find the handler using <a href="http://library.gnome.org/devel/glib/unstable/glib-Dynamic-Loading-of-Modules.html#g-module-symbol"><code class="function">g_module_symbol()</code></a>,
but this can be changed by passing a custom <a class="link" href="GtkBuilder.html#GtkBuilderConnectFunc" title="GtkBuilderConnectFunc ()"><span class="type">GtkBuilderConnectFunc</span></a>
to <a class="link" href="GtkBuilder.html#gtk-builder-connect-signals-full" title="gtk_builder_connect_signals_full ()"><code class="function">gtk_builder_connect_signals_full()</code></a>. The remaining attributes,
"after", "swapped" and "object", have the same meaning as the
corresponding parameters of the <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-connect-object"><code class="function">g_signal_connect_object()</code></a> or
<a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-connect-data"><code class="function">g_signal_connect_data()</code></a> functions. A "last_modification_time" attribute
is also allowed, but it does not have a meaning to the builder.
</p>
<p>
Sometimes it is necessary to refer to widgets which have implicitly
been constructed by GTK+ as part of a composite widget, to set
properties on them or to add further children (e.g. the <em class="parameter"><code>vbox</code></em>
of a <a class="link" href="GtkDialog.html" title="GtkDialog"><span class="type">GtkDialog</span></a>). This can be achieved by setting the "internal-child"
propery of the &lt;child&gt; element to a true value. Note that
GtkBuilder still requires an &lt;object&gt; element for the internal
child, even if it has already been constructed.
</p>
<p>
A number of widgets have different places where a child can be
added (e.g. tabs vs. page content in notebooks). This can be reflected
in a UI definition by specifying the "type" attribute on a &lt;child&gt;
The possible values for the "type" attribute are described in
the sections describing the widget-specific portions of UI definitions.
</p>
<div class="example">
<a name="id1305364"></a><p class="title"><b>Example 61. A GtkBuilder UI Definition</b></p>
<div class="example-contents">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="symbol">&lt;</span><span class="normal">interface</span><span class="symbol">&gt;</span>
<span class="normal">  </span><span class="symbol">&lt;</span><span class="usertype">object</span><span class="normal"> class</span><span class="symbol">=</span><span class="string">"GtkDialog"</span><span class="normal"> id</span><span class="symbol">=</span><span class="string">"dialog1"</span><span class="symbol">&gt;</span>
<span class="normal">    </span><span class="symbol">&lt;</span><span class="usertype">child</span><span class="normal"> internal</span><span class="symbol">-</span><span class="normal">child</span><span class="symbol">=</span><span class="string">"vbox"</span><span class="symbol">&gt;</span>
<span class="normal">      </span><span class="symbol">&lt;</span><span class="usertype">object</span><span class="normal"> class</span><span class="symbol">=</span><span class="string">"GtkVBox"</span><span class="normal"> id</span><span class="symbol">=</span><span class="string">"vbox1"</span><span class="symbol">&gt;</span>
<span class="normal">        </span><span class="symbol">&lt;</span><span class="usertype">property</span><span class="normal"> name</span><span class="symbol">=</span><span class="string">"border-width"</span><span class="symbol">&gt;</span><span class="number">10</span><span class="symbol">&lt;/</span><span class="normal">property</span><span class="symbol">&gt;</span>
<span class="normal">        </span><span class="symbol">&lt;</span><span class="usertype">child</span><span class="normal"> internal</span><span class="symbol">-</span><span class="normal">child</span><span class="symbol">=</span><span class="string">"action_area"</span><span class="symbol">&gt;</span>
<span class="normal">          </span><span class="symbol">&lt;</span><span class="usertype">object</span><span class="normal"> class</span><span class="symbol">=</span><span class="string">"GtkHButtonBox"</span><span class="normal"> id</span><span class="symbol">=</span><span class="string">"hbuttonbox1"</span><span class="symbol">&gt;</span>
<span class="normal">            </span><span class="symbol">&lt;</span><span class="usertype">property</span><span class="normal"> name</span><span class="symbol">=</span><span class="string">"border-width"</span><span class="symbol">&gt;</span><span class="number">20</span><span class="symbol">&lt;/</span><span class="normal">property</span><span class="symbol">&gt;</span>
<span class="normal">            </span><span class="symbol">&lt;</span><span class="normal">child</span><span class="symbol">&gt;</span>
<span class="normal">              </span><span class="symbol">&lt;</span><span class="usertype">object</span><span class="normal"> class</span><span class="symbol">=</span><span class="string">"GtkButton"</span><span class="normal"> id</span><span class="symbol">=</span><span class="string">"ok_button"</span><span class="symbol">&gt;</span>
<span class="normal">                </span><span class="symbol">&lt;</span><span class="usertype">property</span><span class="normal"> name</span><span class="symbol">=</span><span class="string">"label"</span><span class="symbol">&gt;</span><span class="normal">gtk</span><span class="symbol">-</span><span class="normal">ok</span><span class="symbol">&lt;/</span><span class="normal">property</span><span class="symbol">&gt;</span>
<span class="normal">                </span><span class="symbol">&lt;</span><span class="usertype">property</span><span class="normal"> name</span><span class="symbol">=</span><span class="string">"use-stock"</span><span class="symbol">&gt;</span><span class="normal"><a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS">TRUE</a></span><span class="symbol">&lt;/</span><span class="normal">property</span><span class="symbol">&gt;</span>
<span class="normal">                </span><span class="symbol">&lt;</span><span class="usertype">signal</span><span class="normal"> name</span><span class="symbol">=</span><span class="string">"clicked"</span><span class="normal"> handler</span><span class="symbol">=</span><span class="string">"ok_button_clicked"</span><span class="symbol">/&gt;</span>
<span class="normal">              </span><span class="symbol">&lt;/</span><span class="normal">object</span><span class="symbol">&gt;</span>
<span class="normal">            </span><span class="symbol">&lt;/</span><span class="normal">child</span><span class="symbol">&gt;</span>
<span class="normal">          </span><span class="symbol">&lt;/</span><span class="normal">object</span><span class="symbol">&gt;</span>
<span class="normal">        </span><span class="symbol">&lt;/</span><span class="normal">child</span><span class="symbol">&gt;</span>
<span class="normal">      </span><span class="symbol">&lt;/</span><span class="normal">object</span><span class="symbol">&gt;</span>
<span class="normal">    </span><span class="symbol">&lt;/</span><span class="normal">child</span><span class="symbol">&gt;</span>
<span class="normal">  </span><span class="symbol">&lt;/</span><span class="normal">object</span><span class="symbol">&gt;</span>
<span class="symbol">&lt;/</span><span class="normal">interface</span><span class="symbol">&gt;</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

</div>
<br class="example-break"><p>
Beyond this general structure, several object classes define
their own XML DTD fragments for filling in the ANY placeholders
in the DTD above. Note that a custom element in a &lt;child&gt;
element gets parsed by the custom tag handler of the parent
object, while a custom element in an &lt;object&gt; element
gets parsed by the custom tag handler of the object.
</p>
<p>
These XML fragments are explained in the documentation of the
respective objects, see
<a class="link" href="GtkWidget.html#GtkWidget-BUILDER-UI" title="GtkWidget as GtkBuildable">GtkWidget</a>,
<a class="link" href="GtkLabel.html#GtkLabel-BUILDER-UI" title="GtkLabel as GtkBuildable">GtkLabel</a>,
<a class="link" href="GtkWindow.html#GtkWindow-BUILDER-UI" title="GtkWindow as GtkBuildable">GtkWindow</a>,
<a class="link" href="GtkContainer.html#GtkContainer-BUILDER-UI" title="GtkContainer as GtkBuildable">GtkContainer</a>,
<a class="link" href="GtkDialog.html#GtkDialog-BUILDER-UI" title="GtkDialog as GtkBuildable">GtkDialog</a>,
<a class="link" href="GtkCellLayout.html#GtkCellLayout-BUILDER-UI" title="GtkCellLayouts as GtkBuildable">GtkCellLayout</a>,
<a class="link" href="GtkColorSelectionDialog.html#GtkColorSelectionDialog-BUILDER-UI" title="GtkColorSelectionDialog as GtkBuildable">GtkColorSelectionDialog</a>,
<a class="link" href="GtkFontSelectionDialog.html#GtkFontSelectionDialog-BUILDER-UI" title="GtkFontSelectionDialog as GtkBuildable">GtkFontSelectionDialog</a>,
<a class="link" href="GtkComboBoxEntry.html#GtkComboBoxEntry-BUILDER-UI" title="GtkComboBoxEntry as GtkBuildable">GtkComboBoxEntry</a>,
<a class="link" href="GtkExpander.html#GtkExpander-BUILDER-UI" title="GtkExpander as GtkBuildable">GtkExpander</a>,
<a class="link" href="GtkFrame.html#GtkFrame-BUILDER-UI" title="GtkFrame as GtkBuildable">GtkFrame</a>,
<a class="link" href="GtkListStore.html#GtkListStore-BUILDER-UI" title="GtkListStore as GtkBuildable">GtkListStore</a>,
<a class="link" href="GtkTreeStore.html#GtkTreeStore-BUILDER-UI" title="GtkTreeStore as GtkBuildable">GtkTreeStore</a>,
<a class="link" href="GtkNotebook.html#GtkNotebook-BUILDER-UI" title="GtkNotebook as GtkBuildable">GtkNotebook</a>,
<a class="link" href="GtkSizeGroup.html#GtkSizeGroup-BUILDER-UI" title="GtkSizeGroup as GtkBuildable">GtkSizeGroup</a>,
<a class="link" href="GtkTreeView.html#GtkTreeView-BUILDER-UI" title="GtkTreeView as GtkBuildable">GtkTreeView</a>,
<a class="link" href="GtkUIManager.html#GtkUIManager-BUILDER-UI" title="GtkUIManager as GtkBuildable">GtkUIManager</a>,
<a class="link" href="GtkActionGroup.html#GtkActionGroup-BUILDER-UI" title="GtkActionGroup as GtkBuildable">GtkActionGroup</a>.
<a class="link" href="GtkMenuItem.html#GtkMenuItem-BUILDER-UI" title="GtkMenuItem as GtkBuildable">GtkMenuItem</a>,
<a class="link" href="GtkAssistant.html#GtkAssistant-BUILDER-UI" title="GtkAssistant as GtkBuildable">GtkAssistant</a>,
<a class="link" href="GtkScale.html#GtkScale-BUILDER-UI" title="GtkScale as GtkBuildable">GtkScale</a>.
</p>
</div>
</div>
<div class="refsect1">
<a name="GtkBuilder.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GtkBuilder-struct"></a><h3>struct GtkBuilder</h3>
<pre class="programlisting">struct GtkBuilder;</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkBuilderConnectFunc"></a><h3>GtkBuilderConnectFunc ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                (*GtkBuilderConnectFunc)            (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *object</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *signal_name</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *handler_name</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> *connect_object</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#GConnectFlags"><span class="type">GConnectFlags</span></a> flags</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>
This is the signature of a function used to connect signals.  It is used
by the <a class="link" href="GtkBuilder.html#gtk-builder-connect-signals" title="gtk_builder_connect_signals ()"><code class="function">gtk_builder_connect_signals()</code></a> and <a class="link" href="GtkBuilder.html#gtk-builder-connect-signals-full" title="gtk_builder_connect_signals_full ()"><code class="function">gtk_builder_connect_signals_full()</code></a>
methods.  It is mainly intended for interpreted language bindings, but
could be useful where the programmer wants more control over the signal
connection process.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
<td>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
<td>object to connect a signal to</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>signal_name</code></em> :</span></p></td>
<td>name of the signal</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>handler_name</code></em> :</span></p></td>
<td>name of the handler</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>connect_object</code></em> :</span></p></td>
<td>a <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a>, if non-<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, use <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-connect-object"><code class="function">g_signal_connect_object()</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#GConnectFlags"><span class="type">GConnectFlags</span></a> to use</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>user data</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.12</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkBuilderError"></a><h3>enum GtkBuilderError</h3>
<pre class="programlisting">typedef enum {
  GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION,
  GTK_BUILDER_ERROR_UNHANDLED_TAG,
  GTK_BUILDER_ERROR_MISSING_ATTRIBUTE,
  GTK_BUILDER_ERROR_INVALID_ATTRIBUTE,
  GTK_BUILDER_ERROR_INVALID_TAG,
  GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE,
  GTK_BUILDER_ERROR_INVALID_VALUE,
  GTK_BUILDER_ERROR_VERSION_MISMATCH,
  GTK_BUILDER_ERROR_DUPLICATE_ID
} GtkBuilderError;
</pre>
<p>
Error codes that identify various errors that can occur while
using <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="GTK-BUILDER-ERROR-INVALID-TYPE-FUNCTION:CAPS"></a><span class="term"><code class="literal">GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION</code></span></p></td>
<td>A type-func attribute didn't name
    a function that returns a <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a>.
</td>
</tr>
<tr>
<td><p><a name="GTK-BUILDER-ERROR-UNHANDLED-TAG:CAPS"></a><span class="term"><code class="literal">GTK_BUILDER_ERROR_UNHANDLED_TAG</code></span></p></td>
<td>The input contained a tag that <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
    can't handle.
</td>
</tr>
<tr>
<td><p><a name="GTK-BUILDER-ERROR-MISSING-ATTRIBUTE:CAPS"></a><span class="term"><code class="literal">GTK_BUILDER_ERROR_MISSING_ATTRIBUTE</code></span></p></td>
<td>An attribute that is required by
    <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> was missing.
</td>
</tr>
<tr>
<td><p><a name="GTK-BUILDER-ERROR-INVALID-ATTRIBUTE:CAPS"></a><span class="term"><code class="literal">GTK_BUILDER_ERROR_INVALID_ATTRIBUTE</code></span></p></td>
<td>
<a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> found an attribute that 
    it doesn't understand.
</td>
</tr>
<tr>
<td><p><a name="GTK-BUILDER-ERROR-INVALID-TAG:CAPS"></a><span class="term"><code class="literal">GTK_BUILDER_ERROR_INVALID_TAG</code></span></p></td>
<td>
<a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> found a tag that
    it doesn't understand.
</td>
</tr>
<tr>
<td><p><a name="GTK-BUILDER-ERROR-MISSING-PROPERTY-VALUE:CAPS"></a><span class="term"><code class="literal">GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE</code></span></p></td>
<td>A required property value was 
    missing.
</td>
</tr>
<tr>
<td><p><a name="GTK-BUILDER-ERROR-INVALID-VALUE:CAPS"></a><span class="term"><code class="literal">GTK_BUILDER_ERROR_INVALID_VALUE</code></span></p></td>
<td>
<a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> couldn't parse
    some attribute value.
</td>
</tr>
<tr>
<td><p><a name="GTK-BUILDER-ERROR-VERSION-MISMATCH:CAPS"></a><span class="term"><code class="literal">GTK_BUILDER_ERROR_VERSION_MISMATCH</code></span></p></td>
<td>The input file requires a newer version
    of GTK+.
</td>
</tr>
<tr>
<td><p><a name="GTK-BUILDER-ERROR-DUPLICATE-ID:CAPS"></a><span class="term"><code class="literal">GTK_BUILDER_ERROR_DUPLICATE_ID</code></span></p></td>
<td>An object id occurred twice.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-builder-new"></a><h3>gtk_builder_new ()</h3>
<pre class="programlisting"><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="returnvalue">GtkBuilder</span></a> *        gtk_builder_new                     (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Creates a new builder object.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> object</td>
</tr></tbody>
</table></div>
<p class="since">Since 2.12</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-builder-add-from-file"></a><h3>gtk_builder_add_from_file ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               gtk_builder_add_from_file           (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filename</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Parses a file containing a <a class="link" href="GtkBuilder.html#BUILDER-UI" title="GtkBuilder UI Definitions">GtkBuilder 
UI definition</a> and merges it with the current contents of <em class="parameter"><code>builder</code></em>. 
</p>
<p>
Upon errors 0 will be returned and <em class="parameter"><code>error</code></em> will be assigned a
<a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> from the <a class="link" href="GtkBuilder.html#GTK-BUILDER-ERROR:CAPS" title="GTK_BUILDER_ERROR"><span class="type">GTK_BUILDER_ERROR</span></a>, <a href="http://library.gnome.org/devel/glib/unstable/glib-Simple-XML-Subset-Parser.html#G-MARKUP-ERROR:CAPS"><span class="type">G_MARKUP_ERROR</span></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-File-Utilities.html#G-FILE-ERROR:CAPS"><span class="type">G_FILE_ERROR</span></a> 
domain.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
<td>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>filename</code></em> :</span></p></td>
<td>the name of the file to parse</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>return location for an error, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A positive value on success, 0 if an error occurred</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.12</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-builder-add-from-string"></a><h3>gtk_builder_add_from_string ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               gtk_builder_add_from_string         (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *buffer</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> length</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Parses a string containing a <a class="link" href="GtkBuilder.html#BUILDER-UI" title="GtkBuilder UI Definitions">GtkBuilder 
UI definition</a> and merges it with the current contents of <em class="parameter"><code>builder</code></em>. 
</p>
<p>
Upon errors 0 will be returned and <em class="parameter"><code>error</code></em> will be assigned a
<a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> from the <a class="link" href="GtkBuilder.html#GTK-BUILDER-ERROR:CAPS" title="GTK_BUILDER_ERROR"><span class="type">GTK_BUILDER_ERROR</span></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Simple-XML-Subset-Parser.html#G-MARKUP-ERROR:CAPS"><span class="type">G_MARKUP_ERROR</span></a> domain.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
<td>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>the string to parse</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
<td>the length of <em class="parameter"><code>buffer</code></em> (may be -1 if <em class="parameter"><code>buffer</code></em> is nul-terminated)</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>return location for an error, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A positive value on success, 0 if an error occurred</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.12</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-builder-add-objects-from-file"></a><h3>gtk_builder_add_objects_from_file ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               gtk_builder_add_objects_from_file   (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *filename</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **object_ids</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Parses a file containing a <a class="link" href="GtkBuilder.html#BUILDER-UI" title="GtkBuilder UI Definitions">GtkBuilder 
UI definition</a> building only the requested objects and merges
them with the current contents of <em class="parameter"><code>builder</code></em>. 
</p>
<p>
Upon errors 0 will be returned and <em class="parameter"><code>error</code></em> will be assigned a
<a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> from the <a class="link" href="GtkBuilder.html#GTK-BUILDER-ERROR:CAPS" title="GTK_BUILDER_ERROR"><span class="type">GTK_BUILDER_ERROR</span></a>, <a href="http://library.gnome.org/devel/glib/unstable/glib-Simple-XML-Subset-Parser.html#G-MARKUP-ERROR:CAPS"><span class="type">G_MARKUP_ERROR</span></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-File-Utilities.html#G-FILE-ERROR:CAPS"><span class="type">G_FILE_ERROR</span></a> 
domain.
</p>
<p>
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>
If you are adding an object that depends on an object that is not 
its child (for instance a <a class="link" href="GtkTreeView.html" title="GtkTreeView"><span class="type">GtkTreeView</span></a> that depends on its
<a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a>), you have to explicitely list all of them in <em class="parameter"><code>object_ids</code></em>. 
</p>
</div>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
<td>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>filename</code></em> :</span></p></td>
<td>the name of the file to parse</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>object_ids</code></em> :</span></p></td>
<td>nul-terminated array of objects to build</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>return location for an error, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A positive value on success, 0 if an error occurred</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.14</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-builder-add-objects-from-string"></a><h3>gtk_builder_add_objects_from_string ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               gtk_builder_add_objects_from_string (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *buffer</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> length</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> **object_ids</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Parses a string containing a <a class="link" href="GtkBuilder.html#BUILDER-UI" title="GtkBuilder UI Definitions">GtkBuilder 
UI definition</a> building only the requested objects and merges
them with the current contents of <em class="parameter"><code>builder</code></em>. 
</p>
<p>
Upon errors 0 will be returned and <em class="parameter"><code>error</code></em> will be assigned a
<a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> from the <a class="link" href="GtkBuilder.html#GTK-BUILDER-ERROR:CAPS" title="GTK_BUILDER_ERROR"><span class="type">GTK_BUILDER_ERROR</span></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Simple-XML-Subset-Parser.html#G-MARKUP-ERROR:CAPS"><span class="type">G_MARKUP_ERROR</span></a> domain.
</p>
<p>
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>
If you are adding an object that depends on an object that is not 
its child (for instance a <a class="link" href="GtkTreeView.html" title="GtkTreeView"><span class="type">GtkTreeView</span></a> that depends on its
<a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a>), you have to explicitely list all of them in <em class="parameter"><code>object_ids</code></em>. 
</p>
</div>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
<td>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>the string to parse</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
<td>the length of <em class="parameter"><code>buffer</code></em> (may be -1 if <em class="parameter"><code>buffer</code></em> is nul-terminated)</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>object_ids</code></em> :</span></p></td>
<td>nul-terminated array of objects to build</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>return location for an error, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A positive value on success, 0 if an error occurred</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.14</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-builder-get-object"></a><h3>gtk_builder_get_object ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject"><span class="returnvalue">GObject</span></a> *           gtk_builder_get_object              (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>);</pre>
<p>
Gets the object named <em class="parameter"><code>name</code></em>. Note that this function does not
increment the reference count of the returned object.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
<td>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
<td>name of object to get</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the object named <em class="parameter"><code>name</code></em> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if
it could not be found in the object tree. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.12</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-builder-get-objects"></a><h3>gtk_builder_get_objects ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="returnvalue">GSList</span></a> *            gtk_builder_get_objects             (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>);</pre>
<p>
Gets all objects that have been constructed by <em class="parameter"><code>builder</code></em>. Note that 
this function does not increment the reference counts of the returned
objects.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
<td>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a newly-allocated <a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#GSList"><span class="type">GSList</span></a> containing all the objects
constructed by the <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> instance. It should be freed by
<a href="http://library.gnome.org/devel/glib/unstable/glib-Singly-Linked-Lists.html#g-slist-free"><code class="function">g_slist_free()</code></a>. <span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GObject][<acronym title="Free data container after the code is done."><span class="acronym">transfer container</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.12</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-builder-connect-signals"></a><h3>gtk_builder_connect_signals ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_builder_connect_signals         (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>
This method is a simpler variation of <a class="link" href="GtkBuilder.html#gtk-builder-connect-signals-full" title="gtk_builder_connect_signals_full ()"><code class="function">gtk_builder_connect_signals_full()</code></a>.
It uses <a href="http://library.gnome.org/devel/glib/unstable/glib-Dynamic-Loading-of-Modules.html#GModule"><span class="type">GModule</span></a>'s introspective features (by opening the module <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>) 
to look at the application's symbol table. From here it tries to match
the signal handler names given in the interface description with
symbols in the application and connects the signals.
</p>
<p>
Note that this function will not work correctly if <a href="http://library.gnome.org/devel/glib/unstable/glib-Dynamic-Loading-of-Modules.html#GModule"><span class="type">GModule</span></a> is not
supported on the platform.
</p>
<p>
When compiling applications for Windows, you must declare signal callbacks
with <a href="http://library.gnome.org/devel/glib/unstable/glib-Dynamic-Loading-of-Modules.html#G-MODULE-EXPORT:CAPS"><span class="type">G_MODULE_EXPORT</span></a>, or they will not be put in the symbol table.
On Linux and Unices, this is not necessary; applications should instead
be compiled with the -Wl,--export-dynamic CFLAGS, and linked against
gmodule-export-2.0.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
<td>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>a pointer to a structure sent in as user data to all signals</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.12</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-builder-connect-signals-full"></a><h3>gtk_builder_connect_signals_full ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_builder_connect_signals_full    (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
                                                         <em class="parameter"><code><a class="link" href="GtkBuilder.html#GtkBuilderConnectFunc" title="GtkBuilderConnectFunc ()"><span class="type">GtkBuilderConnectFunc</span></a> func</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>
This function can be thought of the interpreted language binding
version of <a class="link" href="GtkBuilder.html#gtk-builder-connect-signals" title="gtk_builder_connect_signals ()"><code class="function">gtk_builder_connect_signals()</code></a>, except that it does not
require GModule to function correctly.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
<td>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
<td>the function used to connect the signals. <span class="annotation">[<acronym title="The callback is valid only during the call to the method."><span class="acronym">scope call</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>arbitrary data that will be passed to the connection function</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.12</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-builder-set-translation-domain"></a><h3>gtk_builder_set_translation_domain ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_builder_set_translation_domain  (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *domain</code></em>);</pre>
<p>
Sets the translation domain of <em class="parameter"><code>builder</code></em>. 
See <a class="link" href="GtkBuilder.html#GtkBuilder--translation-domain" title='The "translation-domain" property'><span class="type">"translation-domain"</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
<td>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>domain</code></em> :</span></p></td>
<td>the translation domain or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.12</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-builder-get-translation-domain"></a><h3>gtk_builder_get_translation_domain ()</h3>
<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       gtk_builder_get_translation_domain  (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>);</pre>
<p>
Gets the translation domain of <em class="parameter"><code>builder</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
<td>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the translation domain. This string is owned
by the builder object and must not be modified or freed.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.12</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-builder-get-type-from-name"></a><h3>gtk_builder_get_type_from_name ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="returnvalue">GType</span></a>               gtk_builder_get_type_from_name      (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
                                                         <em class="parameter"><code>const <span class="type">char</span> *type_name</code></em>);</pre>
<p>
Looks up a type by name, using the virtual function that 
<a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> has for that purpose. This is mainly used when
implementing the <a class="link" href="GtkBuildable.html" title="GtkBuildable"><span class="type">GtkBuildable</span></a> interface on a type.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
<td>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>type_name</code></em> :</span></p></td>
<td>type name to lookup</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> found for <em class="parameter"><code>type_name</code></em> or <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#G-TYPE-INVALID:CAPS"><span class="type">G_TYPE_INVALID</span></a>
if no type was found</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.12</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-builder-value-from-string"></a><h3>gtk_builder_value_from_string ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gtk_builder_value_from_string       (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a> *pspec</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
This function demarshals a value from a string. This function
calls <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#g-value-init"><code class="function">g_value_init()</code></a> on the <em class="parameter"><code>value</code></em> argument, so it need not be
initialised beforehand.
</p>
<p>
This function can handle char, uchar, boolean, int, uint, long,
ulong, enum, flags, float, double, string, <a href="../gdk/gdk-Colormaps-and-Colors.html#GdkColor"><span class="type">GdkColor</span></a> and
<a class="link" href="GtkAdjustment.html" title="GtkAdjustment"><span class="type">GtkAdjustment</span></a> type values. Support for <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> type values is
still to come.
</p>
<p>
Upon errors <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> will be returned and <em class="parameter"><code>error</code></em> will be assigned a
<a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> from the <a class="link" href="GtkBuilder.html#GTK-BUILDER-ERROR:CAPS" title="GTK_BUILDER_ERROR"><span class="type">GTK_BUILDER_ERROR</span></a> domain.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
<td>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>pspec</code></em> :</span></p></td>
<td>the <a href="http://library.gnome.org/devel/gobject/unstable/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a> for the property</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td>
<td>the string representation of the value</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
<td>the <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> to store the result in. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>return location for an error, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.12</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-builder-value-from-string-type"></a><h3>gtk_builder_value_from_string_type ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gtk_builder_value_from_string_type  (<em class="parameter"><code><a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> *builder</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> type</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *string</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> *value</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Like <a class="link" href="GtkBuilder.html#gtk-builder-value-from-string" title="gtk_builder_value_from_string ()"><code class="function">gtk_builder_value_from_string()</code></a>, this function demarshals 
a value from a string, but takes a <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> instead of <a href="http://library.gnome.org/devel/gobject/unstable/gobject-GParamSpec.html#GParamSpec"><span class="type">GParamSpec</span></a>.
This function calls <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#g-value-init"><code class="function">g_value_init()</code></a> on the <em class="parameter"><code>value</code></em> argument, so it 
need not be initialised beforehand.
</p>
<p>
Upon errors <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> will be returned and <em class="parameter"><code>error</code></em> will be assigned a
<a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> from the <a class="link" href="GtkBuilder.html#GTK-BUILDER-ERROR:CAPS" title="GTK_BUILDER_ERROR"><span class="type">GTK_BUILDER_ERROR</span></a> domain.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>builder</code></em> :</span></p></td>
<td>a <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
<td>the <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> of the value</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td>
<td>the string representation of the value</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>value</code></em> :</span></p></td>
<td>the <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a> to store the result in. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>return location for an error, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> on success</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.12</p>
</div>
<hr>
<div class="refsect2">
<a name="GTK-BUILDER-WARN-INVALID-CHILD-TYPE:CAPS"></a><h3>GTK_BUILDER_WARN_INVALID_CHILD_TYPE()</h3>
<pre class="programlisting">#define             GTK_BUILDER_WARN_INVALID_CHILD_TYPE(object, type)</pre>
<p>
This macro should be used to emit a warning about and unexpected
<em class="parameter"><code>type</code></em> value in a <a class="link" href="GtkBuildable.html" title="GtkBuildable"><span class="type">GtkBuildable</span></a> add_child implementation.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
<td>the <a class="link" href="GtkBuildable.html" title="GtkBuildable"><span class="type">GtkBuildable</span></a> on which the warning ocurred</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
<td>the unexpected type value</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="GTK-BUILDER-ERROR:CAPS"></a><h3>GTK_BUILDER_ERROR</h3>
<pre class="programlisting">#define GTK_BUILDER_ERROR                (gtk_builder_error_quark ())
</pre>
<p>
The <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> quark for <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> errors
</p>
</div>
</div>
<div class="refsect1">
<a name="GtkBuilder.property-details"></a><h2>Property Details</h2>
<div class="refsect2">
<a name="GtkBuilder--translation-domain"></a><h3>The <code class="literal">"translation-domain"</code> property</h3>
<pre class="programlisting">  "translation-domain"       <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>*                : Read / Write</pre>
<p>
The translation domain used when translating property values that
have been marked as translatable in interface descriptions.
If the translation domain is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, <a class="link" href="GtkBuilder.html" title="GtkBuilder"><span class="type">GtkBuilder</span></a> uses <code class="function">gettext()</code>,
otherwise <a href="http://library.gnome.org/devel/glib/unstable/glib-I18N.html#g-dgettext"><code class="function">g_dgettext()</code></a>.
</p>
<p>Default value: NULL</p>
<p class="since">Since 2.12</p>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>